package com.pb.camera.utils;

public class Constants {

	public static String SERVER = "123.57.251.213:8080";

	public static String getCodeUrl(String phoneNum, String find_or_log) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=Getcode&m=" + phoneNum
				+ "&p=" + find_or_log;
	}

	public static String compareCodeUrl(String phoneNum,
			String vertification_code) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=ValidateCode&m="
				+ phoneNum + "&v=" + vertification_code;

	}

	public static String findPasspordUrl(String phoneNum) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=Getcode&m=" + phoneNum
				+ "&p=0";

	}

	public static String getCodeUrl2(String phoneNum) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=Getcode&m=" + phoneNum
				+ "&p=1";

	}

	public static String checkAccountUnique(String accountName) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=AjaxChkAcco&u="
				+ accountName;

	}

	public static String register(String phoneNum, String accountName,
			String password, String emial, String token, String gesture) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=Register&m="
				+ phoneNum + "&u=" + accountName + "&p=" + password + "&e="
				+ emial + "&t=" + token + "&g=" + gesture;

	}

	public static String login(String accountName_or_phoneNum, String password,
			String token, String weiXinOpenId) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=Login&u="
				+ accountName_or_phoneNum + "&p=" + password + "&t=" + token
				+ "&o=" + weiXinOpenId;

	}

	public static String findPassword2(String phoneNum, String verrificationCode) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetPwd&m=" + phoneNum
				+ "&v=" + verrificationCode;

	}

	public static String check_if_weixin_and_account_binded(String weiXinOpenId) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=Bind&o="
				+ weiXinOpenId;

	}

	public static String weiXinRegister(String phoneNum, String verrification,
			String emial, String weiXinOpenId, String token, String gesture) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=WXregister&m="
				+ phoneNum + "&v=" + verrification + "&e=" + emial + "&o="
				+ weiXinOpenId + "&t=" + token + "&g=" + gesture;

	}

	public static String settingGesture(String userId, String gesture) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=SetGesture&u="
				+ userId + "&g=" + gesture;

	}

	public static String updataPassword(String accountName_or_phoneNum,
			String oldPassword, String newPassword) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=UpdatePwd&u="
				+ accountName_or_phoneNum + "&o=" + oldPassword + "&n="
				+ newPassword;

	}

	public static String updatePhoneNum(String newPhoneNum,
			String verrificationCode, String oldPhoneNum_or_accountName) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=UpdatePhone&u="
				+ oldPhoneNum_or_accountName + "&v=" + verrificationCode
				+ "&m=" + newPhoneNum;

	}

	public static String BindWeiXin(String accountName_or_phoneNum,
			String weiXinOpenId, String bind_or_unbind) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=CenterBind&u="
				+ accountName_or_phoneNum + "&o=" + weiXinOpenId + "&p="
				+ bind_or_unbind;

	}

	public static String addEquipment(String group, String equipment_type,
			String equipment_num, String user_id) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=AddDevJudge&g="
				+ group + "&t=" + equipment_type + "&d=" + equipment_num
				+ "&u=" + user_id;
	}

	public static String getEnvironmentMode(String user_id) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetModelType&u="
				+ user_id;

	}

	public static String getEquipmentData(String devid) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=QryApplicationData&d="
				+ devid;

	}

	// //////////第三模块的接口
	public static String ifDeviceLinkaged(String deviceId, String parameter) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetDevLink&d="
				+ deviceId + "&p=" + parameter;

	}

	public static String selectDeviceLinkagedState(String deviceId,
			String parameter) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetDevLink&d="
				+ deviceId + "&p=" + parameter;

	}

	public static String setSocketTimerTask(String deviceId, String n,
			String w, String on, String off, String ito) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=SetSockTask&d="
				+ deviceId + "&n=" + n + "&w=" + w + "&on=" + on + "&off="
				+ off + "&ito=" + ito;

	}

	public static String deleteSocketTimerTask(String deviceId, String n) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=DeleteSockTask&d="
				+ deviceId + "&n=" + n;

	}

	public static String selectSocketTimerTask(String deviceId) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetSockTask&d="
				+ deviceId;

	}

	//
	/**
	 * @param devideId
	 *            环境探测器的id
	 * @param parameter
	 *            参数
	 * @param f
	 *            智能插座的编号
	 * @return
	 */
	public static String socketLinkage(String devideId, String parameter,
			String f) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=SockLinkage&d="
				+ devideId + "&p=" + parameter + "&f=" + f;

	}

	// 只可以是空调使用这个接口
	public static String AirConditionlearnInflaredCode(String deviceId,
			String airconditionName) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=AutoMach&d="
				+ deviceId + "&n=" + airconditionName;

	}

	public static String AirConditionStopLearnInflaredCode(String deviceId,
			String s) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=StopAutoMach&s=" + s
				+ "&d=" + deviceId;

	}

	public static String selectAirConditionName() {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetAirName";

	}

	// 只有红外转发器可以使用该接口
	public static String InfraredTransponderLearnInfraredCode(String deviceId,
			String parameter) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=StudyIRCode&d="
				+ deviceId + "&p=" + parameter;

	}

	public static String sendInfraredCode(String deviceType, String deviceId,
			String serialNum, String airConditionState) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=SendIRCode&d="
				+ deviceId + "&t=" + deviceType + "&s=" + serialNum + "&ls="
				+ airConditionState;

	}

	public static String getUnbindedSocketFromGroup(String groupName) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=NotLinkSock&g="
				+ groupName;

	}

	public static String getAllAirConditionName() {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetAirName";
	}

	public static String autoLearnInfrared(String deviceId, String name,
			String parameter) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=AutoMach&d="
				+ deviceId + "&n=" + name;
	}

	public static String getLineChartDateSet(String deviciId, String add_flush,
			String startPosition, String page, String count, String type) {
		if (page == null) {
			return "http://"
					+ SERVER
					+ "/cgi-bin/appserver/AppAction?function=ParamStatistics&d="
					+ deviciId + "&f=" + add_flush + "&i=" + startPosition
					+ "&r=" + count + "&p=" + "&t=" + type;
		}
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=ParamStatistics&d="
				+ deviciId + "&f=" + add_flush + "&i=" + startPosition + "&r="
				+ count + "&p=" + page + "&t=" + type;
	}

	/**
	 * @param deviceType
	 * @param deviceId
	 * @param control
	 *            17代表socket打开 18 代表socket关闭
	 * @return
	 */
	public static String controlSocketOnOff(String deviceType, String deviceId,
			String control) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=SendControlCmd&t="
				+ deviceType + "&d=" + deviceId + "&c=" + control;

	}

	public static String getCurrentCityData(String userId, String city) {

		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=CityEnvParam&n="
				+ city + "&u=" + userId;

	}

	/**
	 * 获取添加房间的时候,设置的默认的正常范围内的数据 ,一旦超越范围需要报警,同事显示数据的时候要有提示
	 * 
	 * @param modeNum
	 * @return
	 */
	public static String getEnvironmentDeviceDefaultData(String modeNum) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetEnvModel&m="
				+ modeNum;
	}

	public static String getSelectedEnvironmentMode(String userId, String mid,
			String devgroup) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=GetModel&u=" + userId
				+ "&m=" + mid + "&g=" + devgroup;
	}

	/**
	 * @param deviceId
	 * @param parameter
	 * @param linkageMode联动方式
	 *            ：0插座，1红外
	 * @return
	 */
	public static String getDlelteDeviceLinkage(String deviceId,
			String parameter, String linkageMode) {
		return "http://" + SERVER
				+ "/cgi-bin/appserver/AppAction?function=DelSockLinkage&d="
				+ deviceId + "&p=" + parameter + "&f=" + linkageMode;
	}

}
